<menu>
	<ul>
		<li><a>Documents of {{ app.user.username }}</a></li>
		<li>
			<form id="form_search" method="post" action="">
				<input type="text" class="searchfield" name="search" />
				<input type="submit" value="search" class="searchbutton" />
			</form>
		</li>
		<li><a onclick="var left = (screen.width/2)-(400/2); var top = (screen.height/2)-(400/2); window.open('{{ path('cadss_test_upload') }}', '_blank', 'toolbar=No, scrollbars=No, resizable=No, fullscreen=No, top='+top+', left='+left+', width=400, height=400');">Upload Document</a></li>
		<li><a href="{{ path('cadss_test_keywords') }}">Manage Keywords</a></li>
		<li><a href="{{ path('fos_user_security_logout') }}">{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}</a></li>
	</ul>
</menu>
<br />
<br />
<div id="files">
	<table>
		<tr>
			<th width="100">Title</th>
			<th width="300">Description</th>
			<th width="300">Keywords</th>
			<th width="100">Uploader</th>
			<th width="110">Upload date</th>
			<th width="100"></th>
		</tr>
		{% for file in files %}
		<tr>
			<td>{{ file.dTitel }}</td>	
			<td>{{ file.dOmschrijving }}</td>
			<td>
				{% for keyword in file.keywords %}
					{{keyword.keyword}}, 
				{% endfor %}
			</td>
			<td>{{ file.User.username }}</td>
			<td>{{ file.dDatum|date('d-m-Y') }}</td>
			<td>
				<a href="{{ asset('uploads/documents/') }}{{ file.path }}"><img src="{{ asset('img/download.png') }}" title="download" alt="download" width="15" height="15"/></a>
				{% if file.dUid == app.security.getToken().getUser().getId()  %}
					<a onclick="var left = (screen.width/2)-(400/2); var top = (screen.height/2)-(400/2); window.open('{{ path('cadss_test_edit_document', {'id': file.id}) }}', '_blank', 'toolbar=no, scrollbars=no, resizable=no, top='+top+', left='+left+', width=400, height=400');"><img src="{{ asset('img/edit.png') }}" title="edit" alt="edit" width="15" height="15"/></a>
					<a href="{{ path('cadss_test_delete_document', {'id': file.id}) }}"><img src="{{ asset('img/delete.png') }}" title="delete" alt="delete" width="15" height="15"/></a>
				{% endif %}
			</td>
		</tr>
		{% endfor %}
	</table>
</div>